﻿<Window x:Class="PirateShare.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Title="PirateShare (pirateshare.codeplex.com)" Height="450" Width="700" Loaded="Window_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        
        
        <TabControl HorizontalAlignment="Stretch" Name="tabsMainWindow" VerticalAlignment="Stretch" Grid.Row="0">
            <TabItem Header="File-Search" Name="tabSearch">
                <Grid>
                    <TextBlock>bla</TextBlock>
                </Grid>
            </TabItem>
            <TabItem Header="Downloads" Name="tabDownloads">
                <Grid />
            </TabItem>
            <TabItem Header="Friends" Name="tabFriends">
                <Grid />
            </TabItem>
            <TabItem Header="Shared" Name="tabShared">
                <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <GroupBox Header="Your shared folders" DockPanel.Dock="Top">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="100" />
                            </Grid.ColumnDefinitions>
                            <ListBox Name="lstSharedFolders" VerticalAlignment="Stretch" Grid.Column="0" Margin="2,1,2,1" ItemsSource="{Binding Path=CurrentSharedFolders}"/>
                            <StackPanel Grid.Column="1">
                                <Button Name="btnAddFolder" Margin="2,1,2,1" Click="btnAddFolder_Click">Add</Button>
                                <Button Name="btnDelFolder" Margin="2,1,2,1" Click="btnDelFolder_Click">Delete</Button>
                                <Button Name="btnReindex" Margin="2,1,2,1" Click="btnReindex_Click">
                                    <StackPanel HorizontalAlignment="Stretch">
                                        <TextBlock HorizontalAlignment="Center" Name="txtReindexText">Reindex</TextBlock>
                                        <ProgressBar Name="pbIndex" Height="15" Width="80" IsIndeterminate="False" />
                                    </StackPanel>
                                </Button>
                            </StackPanel>
                        </Grid>
                    </GroupBox>
                    <ListView Name="lstSharedFiles" GridViewColumnHeader.Click="lstSharedFilesHeader_Click"
          ItemsSource="{Binding Path=CurrentSharedFiles}" DockPanel.Dock="Bottom" VerticalAlignment="Stretch">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="Filename"  
                      Width="Auto"
               DisplayMemberBinding="{Binding Path=Name}" />
                                <GridViewColumn Header="Size"
                      Width="Auto"
               DisplayMemberBinding="{Binding Path=HumanReadableSize}" />
                                <GridViewColumn Header="Type"
                      Width="Auto"
               DisplayMemberBinding="{Binding Path=Type}" />
                                <GridViewColumn Header="SHA-1"
                      Width="Auto"
               DisplayMemberBinding="{Binding Path=Hash}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                </DockPanel>
            </TabItem>
        </TabControl>
        <StatusBar VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="25" Grid.Row="1"></StatusBar>
    </Grid>
</Window>
